//
//  AppDelegate.swift
//  Hunter
//
//  Created by oher on 15/6/24.
//  Copyright © 2015年 刘🐑. All rights reserved.
//

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?


    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        //统一样式
        setupAppearance()
        
        //导航栏颜色设置
        UIApplication.sharedApplication().statusBarStyle = UIStatusBarStyle.LightContent
        
        window = UIWindow(frame: UIScreen.mainScreen().bounds)
        window?.rootViewController = XVMainViewController()
        window?.makeKeyAndVisible()
        return true
    }

    /// 设置外观
    private func setupAppearance() {
        // 设置外观，一经设置全局有效，必须早，通常会看到 appDelegate 中存在设置外观的代码
        UINavigationBar.appearance().tintColor = UIColor.whiteColor()
        UITabBar.appearance().tintColor = UIColor.orangeColor()
        
        UINavigationBar.appearance().titleTextAttributes = [NSFontAttributeName : UIFont.systemFontOfSize(15),NSForegroundColorAttributeName:UIColor.whiteColor() ]
        
        //设置导航栏背景图片
        UINavigationBar.appearance().setBackgroundImage(UIImage(named: "myProfile_coverBg_placeholder"), forBarMetrics: UIBarMetrics.Default)
    }

}

